<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="WEB-INF/custom.tld" prefix="foot"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!-- Bootstrap -->
		<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
		<link rel="stylesheet" href="css/jquery.jOrgChart.css"/>
		<link rel="stylesheet" href="css/foot.css"/>
		<title>accueil</title>
	</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">FootMassonMonedierePerrin</a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Accueil</a></li>
            <c:if test="${sessionScope.etat==0}">
	            <li><a href="?action=inscrire" title="inscription de votre équipe">Inscription</a></li>
            </c:if>
           <!-- <li><a href="?action=arbitre">Arbitrage</a></li>  --> 
            <li><a href="?action=admin">Administration</a></li>
          </ul>
        </div>
      </div>
    </div>
    <div class="container">
    <div id="arbre" class="starter-template center" >
    	<h1>État du Tournoi</h1>
    	<foot:JorgChartTree match="${sessionScope.match}"/>
    </div>
    </div>
    <div class="container">
    	<h4>Prochain Match</h4>
    </div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="jquery.jOrgChart.js"></script>
<!-- <ul id="org" style="display:none "> -->
<!-- 	<li>Equipe4 Vs Equipe5 -->
<!-- 		<ul> -->
<!-- 			<li>Equipe2 Vs Equipe4 -->
<!-- 				<ul> -->
<!-- 					<li>Equipe1 Vs Equipe2</li> -->
<!-- 					<li>Equipe3 Vs Equipe4</li> -->
<!-- 				</ul> -->
<!-- 			</li> -->
<!-- 			<li>Equipe5 Vs Equipe7 -->
<!-- 				<ul> -->
<!-- 					<li>Equipe5 Vs Equipe6</li> -->
<!-- 					<li>Equipe7 Vs Equipe8</li> -->
<!-- 				</ul> -->
<!-- 			</li> -->
<!-- 		</ul> -->
<!-- 	</li> -->
<!-- </ul> -->



		<div class="container">
			<h1>État actuel du tournoi</h1>
			<h2>Équipes inscrites</h2>
			<table class="table list table-striped table-bordered">
				<thead>
					<tr>
						<th class="list">équipe</th>
						<th class="list">nombre de joueurs</th>
					</tr>
				</thead>

				<c:if test="${not empty sessionScope.equipes}">
					<c:forEach var="equip" items="${sessionScope.equipes}">
						<tr>
							<td><a href="?action=detailequipe&lequipe=${equip.id }">${equip.nomEquipe}</a></td>
							<td>${fn:length(equip.lesJoueurs)}</td>
						</tr>
					</c:forEach>
				</c:if>

				<c:if test="${empty equipes}">
					<td colspan="2">aucune équipe enregistrée</td>
				</c:if>
			</table>
		</div>

<script>
	jQuery(document).ready(function() {
		
		$("#org").jOrgChart({chartElement : '#arbre'});
	});
</script>
</body>
</html>

